package com.itheima.pxgl.mapper;

import com.itheima.pxgl.entity.pojo.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 九尾
 * @since 2024-05-22
 */
public interface CategoryMapper extends BaseMapper<Category> {
    /**
     * 根据分类名称查找分类id
     * @param categoryName
     * @return
     */
    @Select("select category_id from category where category_name  = #{categoryName}")
    Integer getIdByName(String categoryName);
}
